---
title: Checkbox
description: A Checkbox allows users to select multiple items from a list of individual items, or to mark one individual item as selected.
featured: true
component: true
links:
  doc: https://react-spectrum.adobe.com/react-aria/Checkbox.html
---

Checkboxes can be built with the `<input>` HTML element, but this can be difficult to style. Checkbox helps achieve accessible checkboxes that can be styled as needed.

<ComponentPreview name="checkbox-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Copy & Paste</TabsTrigger>
</TabsList>

<TabsContent value="cli">

<PackageManagerTabs>
  <PackageManagerContent value="npm">
    ```bash
    npx shadcn@latest add https://jollyui.dev/[[STYLE]]/checkbox
    ```
  </PackageManagerContent>
  <PackageManagerContent value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add https://jollyui.dev/[[STYLE]]/checkbox
    ```

  </PackageManagerContent>
  <PackageManagerContent value="bun">
    ```bash
    bunx --bun shadcn@latest add https://jollyui.dev/[[STYLE]]/checkbox
    ```
  </PackageManagerContent>
  <PackageManagerContent value="yarn">
    ```bash 
    npx shadcn@latest add https://jollyui.dev/[[STYLE]]/checkbox
    ```
  </PackageManagerContent>
</PackageManagerTabs>

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>
  This components uses the following components, which you also need to install:
  - [Form (field.tsx)](../../../docs/components/form)
</Step>

<Step>Copy and paste the following code into your project: checkbox.tsx</Step>

<ComponentSource name="checkbox" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Examples

### Basic

<ComponentPreview name="checkbox-demo" />

### Value

#### Indeterminate

<ComponentPreview name="checkbox-indeterminate" />

### Validation

<ComponentPreview name="checkbox-validation" />

### Disabled

<ComponentPreview name="checkbox-disabled" />

#### Read-only

<ComponentPreview name="checkbox-readonly" />
